# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=localsearch
pkgver=3.8.0
pkgrel=0
pkgdesc="Data miners for tracker"
url="https://gitlab.gnome.org/GNOME/localsearch"
# s390x blocked by exempi
arch="all !s390x"
license="GPL-2.0-or-later"
depends="tinysparql"
makedepends="
	asciidoc
	dbus-dev
	enca-dev
	exempi-dev
	flac-dev
	gexiv2-dev
	giflib-dev
	glib-dev
	gobject-introspection-dev
	gst-plugins-base-dev
	gstreamer-dev
	icu-dev
	libexif-dev
	libgsf-dev
	libgudev-dev
	libgxps-dev
	libiptcdata-dev
	libjpeg-turbo-dev
	libosinfo-dev
	libpng-dev
	libseccomp-dev
	libvorbis-dev
	libxml2-dev
	meson
	networkmanager-dev
	poppler-dev
	taglib-dev
	tiff-dev
	tinysparql-dev
	totem-pl-parser-dev
	upower-dev
	zlib-dev
	"
checkdepends="
	bash
	coreutils
	py3-gobject3
	python3
	"
subpackages="$pkgname-dbg $pkgname-lang $pkgname-doc"
source="https://download.gnome.org/sources/localsearch/${pkgver%.*}/localsearch-$pkgver.tar.xz
	landlock-gcc14.patch"
options="!check" # needs to install itself

# for backwards compatibility
replaces="tracker-miners"
provides="tracker-miners=$pkgver-r$pkgrel"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dfunctional_tests="$(want_check && echo true || echo false)" \
		-Dsystemd_user_services=false \
		-Dminer_rss=false \
		-Dlandlock=enabled \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
db7e92c44a6155097e5b68d94257c55880580c3a90e33042b1ca8c348ecaa0b290e7de7cee277c1345e0ca4c4dd50bbc3e2e9bd3b4dfc1237fd57b61aae0e1d4  localsearch-3.8.0.tar.xz
ece428484ad0b1f29d14802aa36580a58576dc1577872338df0d6e90a7ea7d8210c7eb95f033e30488296e55ea59ff4bd16dde5a52f297c674e7d664465c2256  landlock-gcc14.patch
"
